package com.xuecheng.content.api;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 引用freemarker模板引擎
 *
 * @Author Endeavor-ZQB
 * @Create 2023/2/9 21:13
 * @Version 1.0
 */
@Controller
public class FreemarkerController {

    @GetMapping("testfreemarker")
    public ModelAndView test(){
        ModelAndView modelAndView = new ModelAndView();
        //设置模板数据
        modelAndView.addObject("name","小明");
        //设置模板名称
        modelAndView.setViewName("test");

        return modelAndView;
    }
}
